import React, {FC} from 'react';
import "./index.less";
import {Collapse} from "antd";
import type {GetProps} from 'antd';
import classNames from "classnames";
import HxIcon from "@/components/HxIcon";

interface HxLineCollapseProps extends GetProps<typeof Collapse> {
}

/**
 * 折叠面板
 */
const HxLineCollapse: FC<HxLineCollapseProps> = (props) => {
  const {className, ...rest} = props;
  return (
    <Collapse
      className={classNames("hx-line-collapse", className)}
      expandIcon={(panelProps) => <HxIcon className={"hx-line-collapse-icon"}
                                          type={panelProps.isActive ? "hxicon-shousuo2" : "hxicon-shousuo1"}/>}
      {...rest}
    />
  );
};

export default HxLineCollapse;
